<?php
	require_once '../../Helpers/DbHelper.php';
	require_once '../../Helpers/PathHelper.php';
	require_once '../../Controllers/UserController.php';

	$u = new UserController();
	$u->evaluatePagePermission(UserController::ADMINISTRATOR);
	//
	require_once '../../Controllers/EnrolmentController.php';
	require_once '../../Helpers/PathHelper.php';
	if(isset($_POST['enrol']))
	{
		require_once '../../Controllers/StudentController.php';
		$c = new EnrolmentController();
		$s = new StudentController();
		$yearLevelElem = $s->getYearLevelByDepartment('2');
		$s = '';
		if($_POST['enrol'] == 'Enrol Pre-Elementary')
		{
			$s = EnrolmentController::PRE_ELEMENTARY;
		}
		else if($_POST['enrol'] == 'Enrol Elementary')
		{
			$s = EnrolmentController::ELEMENTARY;
		}
		$c->enrol($s, EnrolmentController::CREATE);
	}
?>
<html>
	<?php
		require_once '../commons.php';
		require_once '../Partials/enrolment.php';
		renderEnrolmentHead();
	?>
  <body>
    <div class="container">
		<?php renderAdminNav(); ?>
		<ul class="tabs">
          <li><a href="#tab1">Pre-Elementary</a></li>
          <li><a href="#tab2">Elementary</a></li>
		</ul>
		<div class="tab_container">
			<?php $c = EnrolmentController::CREATE; ?>
			<?php renderEnrolmentForm($c, EnrolmentController::PRE_ELEMENTARY); ?>
			<?php renderEnrolmentForm($c, EnrolmentController::ELEMENTARY); ?>
			<a id="prev-next" href="<?php echo PathHelper::getBaseUrl() ?>/Views/Admin/input_fees.php">Next Step &rarr;</a>
		</div>
    </div>
  </body>
</html>
